#include <iostream>
#include <sys/time.h>
using namespace std;



int main()
{
    struct timeval start, finish;
    size_t maxIter = 1e17;
    double a[5], b[5];
    
    gettimeofday(&start, NULL);
    size_t iter = 0;
    while(iter < maxIter)
    {
        for(size_t i = 0; i < 5; i++)
        {
            a[i] = 0.0;
            b[i] = 0.0;
        }
        iter++;
    }
    gettimeofday(&finish, NULL);
    double totaltime = finish.tv_sec-start.tv_sec 
        + (finish.tv_usec-start.tv_usec) / 1000000;

    cout << "Total Elapsed: " << totaltime << " sec" << endl;

    gettimeofday(&start, NULL);
    iter = 0;
    while(iter < maxIter)
    {
        a[4] = 0.0;
        b[4] = 0.0;

        a[2] = 0.0;
        b[2] = 0.0;

        a[0] = 0.0;
        b[0] = 0.0;

        a[1] = 0.0;
        b[1] = 0.0;

        a[3] = 0.0;
        b[3] = 0.0;
        iter++;
    }
    gettimeofday(&finish, NULL);
    totaltime = finish.tv_sec-start.tv_sec 
        + (finish.tv_usec-start.tv_usec) / 1000000;

    cout << "Total Elapsed: " << totaltime << " sec" << endl;

    gettimeofday(&start, NULL);
    iter = 0;
    double a0, a1, a2, a3, a4;
    double b0, b1, b2, b3, b4;
    while(iter < maxIter)
    {
        a0 = 0.0;
        a1 = 0.0;
        a2 = 0.0;
        a3 = 0.0;
        a4 = 0.0;

        b0 = 0.0;
        b1 = 0.0;
        b2 = 0.0;
        b3 = 0.0;
        b4 = 0.0;
        iter++;
    }
    gettimeofday(&finish, NULL);
    totaltime = finish.tv_sec-start.tv_sec 
        + (finish.tv_usec-start.tv_usec) / 1000000;

    cout << "Total Elapsed: " << totaltime << " sec" << endl;











    return 0;
}
